<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>

<%@ include file="/WEB-INF/views/shared/master/contentHeader.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/index.jsp"%>
<style type="text/css">

</style>

<t:form commandName="teacherSearch" action="/admin/user/teacher/index" ajaxPost="true" onSuccess="onSuccess">
	<t:panel cssClass="panel-flat border-top-xlg border-top-primary" customBody="true" customHead="true">
		<t:panelHead title='导师管理'></t:panelHead>
		<div class="panel-body">
			<div class="row">
				<c:import url="input.jsp" />
			</div>
			<div id="tableContent" class="row">
				<c:import url="output.jsp" />
			</div>
		</div>
	</t:panel>
</t:form>

<script type="text/javascript">
	


	$(function(){
		bindStudentClick();
	});
	
	

	function onSuccess(res){
		$("#tableContent").html(res);
		
		redrawTable();
		
		bindStudentClick();
	}
	function searchCallback(){
		formSubmit();
	}
	function pagerChangeCallback(){
		formSubmit();
	}
	function sortingCallback(){
		formSubmit();
	}
	function formSubmit(){
		$("form:first").submit();	
	}
	
	function bindStudentClick(){
		var sourceHeight;
		var sourceWidth;
		var sourceLeft;
		var sourceTop;
		
		$(".panel-teacher").on("click",function(){
			if($(this).hasClass("bg-teacher")){
				$(this).removeClass("bg-teacher");
			}else{
				$(".panel-teacher.bg-teacher").removeClass("bg-teacher");
				$(this).addClass("bg-teacher");
			}
		});
		
		$(".panel-teacher").on("mouseenter",function(){
			sourceHeight=$(this).outerHeight();
			sourceWidth=$(this).outerWidth();
			sourceLeft=($(this).outerWidth(true)-$(this).outerWidth())/2;
			sourceTop=($(this).outerHeight(true)-$(this).outerHeight())/2;
		});

		$(".panel-teacher").on("mouseleave",function(){
			$(this).animate({height:sourceHeight,
				 			 width:sourceWidth,
				 			 marginLeft:sourceLeft,
				 			 marginRight:sourceLeft,
				 			 marginTop:sourceTop,
				 			 marginBottom:sourceTop},14);
		});
		
		$(".panel-teacher").on("mousedown",function(){
			$(this).animate({height:'-=20px',
				 			 width:'-=16px',
				 			 marginLeft:'+=8px',
				 			 marginRight:'+=8px',
				 			 marginTop:'+=10px',
				 			 marginBottom:'+=10px'},14);
		});
		
		$(".panel-teacher").on("mouseup",function(){
			$(this).animate({height:sourceHeight,
				 			 width:sourceWidth,
				 			 marginLeft:sourceLeft,
				 			 marginRight:sourceLeft,
				 			 marginTop:sourceTop,
				 			 marginBottom:sourceTop},14);
		});
	}
</script>

<%@ include file="/WEB-INF/views/shared/master/cntable.jsp"%>

<%@ include file="/WEB-INF/views/shared/base/scripts/jqueryui.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formbuttons.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formstyling.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formselects.jsp"%>

<%@ include file="/WEB-INF/views/shared//master/contentFooter.jsp"%>